<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML>
<html>
  <head>
  	<meta http-equiv="X-UA-Compatible" content="IE=8">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta content="B2B电商平台" name="description"/>
	<meta content="B2B电商平台" name="keyword"/>
	
	<title>B2B电商平台.店铺商品类型维护</title>
	<link rel="icon" href="include/images/icss.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="include/images/icss.ico" type="image/x-icon" />
	<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/global.css" />
	<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/style.css" />
	<script type="text/javascript" src="<%=path %>/include/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="<%=path %>/include/js/cookies.js"></script>
	<script type="text/javascript" src="<%=path %>/include/js/icss.busin.js"></script>
	<script type="text/javascript" src="<%=path %>/include/js/icss.common.js"></script>
	<script type="text/javascript" src="<%=path%>/include/layer/layer.js"></script>	
	<script type="text/javascript" src="<%=path%>/include/uploadify/swfobject.js"></script>
	
	<script type="text/javascript" charset="utf-8" src="<%=path%>/include/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="<%=path%>/include/ueditor/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="<%=path%>/include/ueditor/lang/zh-cn/zh-cn.js"></script>
	
	<style type="text/css">
		body{background:#ebebeb;font-size: 14px;}
		.title_div{
			height: 81px;
			padding-top: 20px;
			text-align: center;
			//border-bottom: 3px solid #e0e0e0;
			background: #fff;
		}
		.titleCss{
			height: 65px;
			width: 790px;
			margin: 0 auto;
			background: url('<%=path %>/images/postTrade/post_trade_one.png') no-repeat 0 0;
		}
		.title_2{
			background-position: 0 -200px;
		}
		.mainDiv{
			margin: 10px auto;
			width: 1190px;
		}
		.nextDiv button{
		    font: 20px "Microsoft YaHei", "SimHei ";
	    	line-height: 63px;
    		width: 203px;
			background: url('<%=path %>/images/postTrade/pic-global.png') no-repeat -148px -558px;
			color: #fff;
		}
	    .subDiv{
	    	margin: 60px 0px 50px;
	    	height: 63px;
	    	text-align: center;
	    }
	    .nextDiv{
	    	width: 279px;
	    	height: 100%;
	    	margin: 0px auto;
	    }
	    .main_div1{
	    	background:#fff; 
	    	height:48px;
	    	margin: 6px 4px 4px 1px;
	    	border-top: 4px solid #F75D5F;
	    	line-height: 48px;
	    	padding: 0px 10px;
	    }
	    .btCss{
	    	height: 22px;
    		width: 60px;
    		background: url('<%=path %>/images/postTrade/abtnBg.png');
    		float: left;
    		margin: 13px 0 0 20px;
    		font-size: 12px;    
    		line-height: 22px;
    		padding-left: 20px;
    		margin-left: 20px;
	    }
	    a {
		    color: #039;
		    text-decoration: none
	    }
	    ul,li{
	    	list-style: none;
	    }
	    .main_div1 li{
	    	float: left;
	    	font-size: 12px;
	    }
	    .saveDraftCss{
	    	float: right;
	    	border: 1px solid #cfcfcf;
	    	color:#333;
	    	line-height:28px;
	    	margin:10px 0px;
	    	padding: 0px 20px;
	    }
	    .saveDraftCss:hover {
	    	background: #ff8048;
	    	color:#fff;
	    	border: 1px solid #f67943;
	    }
	    .getDraftCss:hover {
	    	color:red;
	    }
	    .divCss_title{
	    	background: #fff;
		    height: 40px;
		    font: 18px/40px "Microsoft YaHei", "SimHei ";
		    text-indent: 10px;
		    border-bottom: 1px solid #d1d1d1;
		    color: #000;
		   
	    }
	    .tipH4{
	    	width:80px;
	    	float:left;
	    	font-weight: bold;
	    	line-height: 18px;
	    }
	    .cdyParaCss ul{
	    	width: 280px;border: 1px solid #c7c7c7;height: 22px;
	    }
	    .cdyParaCss ul li{
	    	display:none;
	    }
	    .cdyParaCss .tdL{
	    	text-align: right;width: 152px;
	    }
	    .cdyParaCss .tdR{
	    	text-align: left;padding-left: 10px;vertical-align: middle;
	    }
	    .cdyParaCss .tdR div{
	    	width:280px;border: 1px solid #c7c7c7;height: 22px;
	    }
	    .cdyParaCss .tdR input{
	    	border: 0px;padding: 0px 3px;margin-top: -15px;width: 250px;
	    }
	    .cdyParaCss .tdR s,td div s,.addPrice_css{
    	    float: right;
		    width: 21px;
		    height: 22px;
		    background: url('<%=path %>/images/postTrade/pic-global.png') no-repeat -275px -275px;
	    }
	    .cdyParaCss .tdR select{
	    	appearance:none;-moz-appearance:none;-webkit-appearance:none;
	    	width: 282px;margin: 20px 0 0 -257px;position: absolute;overflow: auto;max-height: 200px;
	    }
	    .cdyParaCss .tdR select option{
	    	heigth:20px;padding:5px 3px 0px;
	    }
	    .cdyParaCss .tdR select option:hover{
	    	background: #ebebeb;
	    }
	    .borderCss{
	    	border-top: 1px dashed #ccc;margin: 20px 80px;padding-bottom: 5px;
	    }
	    .div_title_css{
	    	border: 0px;margin: 15px 80px 10px;white-space: nowrap;
	    }
	    .div_title_css table tr td{
	    	width: 16%;
	    }
	    .div_title_css table tr td input{
	    	width: 90%;height: 22px;
	    }
	    .div_title_css p{
	    	color: #999;padding: 10px 0px 10px 83px;white-space: normal;
	    }
	    .radioCss{
	    	margin: 0px;
	    }
	    .line_color_css td{
	    	border-top: 1px solid #c7c7c7;
	    }
	    .td1{
	    	width: 130px;text-align: right;padding-right: 10px;
	    }
	    .addPrice_css{
	    	height: 11px;
		    background-position: -478px -298px;
		    margin-top: 11px;
		    margin-left: 5px;
		    float: left;
	    }
	    .img_css{
	    	padding-right: 10%;float: left;width: 14%;margin-top: 20px;
	    }
	    .add_img_div{
	     	height: 102px;
    		width: 102px;
	    	background: url('<%=path %>/images/postTrade/addIco.png') no-repeat 0px -50px;
	    }
	    td {
	    	vertical-align: middle;
	    }
	    .save{
		    width:44px;
		    height:24px;
		    line-height:24px;   
		    background-color: transparent;
		    background-repeat: no-repeat;
		    background-position: 0 -203px;
		    border:0;
		    cursor:pointer;
		    font: 12px/1.5 arial,tahoma,\5b8b\4f53;
		    margin: 0 0 0 5px;
		    outline:none;
		    background-image: url('<%=path%>/include/css/img/xs_bgx.png');   
		}
		.tipHn{
	    	line-height: 18px;
	    	width: 151px;text-align: right;padding-right: 10px;
		}
	</style>
	
	<script type="text/javascript">
		  
		  $(function(){
			  	_baseVal();
				_measuringInfo();
				//_initImg();//init upload image
				_getShopyType("2","${pro.typeCode}","1");
				_getShopyType("1","","-1");//店铺类别
			});

		function _goBackPage(){//返回上一页
			window.location.href = "<%=path %>/postTrade/toPostTradeOnePage.do";
		}
		function _selVal(para){//商品参数项搜索
			$("#sel0").css("display","");
			$("#sel0").size(6);
			$(".att0").css("border","1px solid #86b4f8");
			$(".att0 s").css("background-position", "-275px -308px");
		}
		function _baseVal(){
			var productId = $("#productId").val();
			var itemCode = $("#itemCode").val();
			$.ajax({
				type:"post",
				url:'<%=path%>/postTrade/queryProductPageInfo.do',
				dataType:"json",
				data:{productId:productId,itemCode:itemCode},
				success:function(data){
					if(data){
						var arr = data.paraList;
						_paramHtml(arr);
						var imgList = data.proPicList;
						_showImg(imgList);
						var keyList = data.keyList;
						_keyWord(keyList);
						var priceList = data.priceList;
						_proPrice(priceList);
					}
				}
			});
		}
		function _paramHtml(arr){
			var colNames = "0";
			for(var i=0;i<arr.length;i++){
				var d = arr[i];
				colNames += ",att"+d.sortNum;
				var html = "<tr>";
				html += "	<td class='tdL'>"+d.paramName+"：</td>";
				html += "	<td class='tdR'>"+d.paramVal;
				html += "	</td>";
				html += "</tr>";
				$("#cdyPara").append(html);
			}
			_reHeight("rightFrame","contentDiv");
		}

		function _pullList(num,viewCode){//select下拉列表
			var codeName = $("#codeName").val();
			$.ajax({
				type:"post",
				url:'<%=path%>/postTrade/queryDirectoryInfo.do',
				dataType:"json",
				//async:true,
				data:{viewCode:viewCode,codeName:codeName,flag:"1",viewFlag:"view"},
				success:function(data){
					if(data){
						//$("#sel"+num).remove();
						var arr = data.directoryList;
						var html = "";
						if(arr.length==1)
							html += "<select id='sel"+num+"' size='"+arr.length+"' class='att"+num+"' style='display:none;overflow: hidden;'>";
						else
							html += "<select id='sel"+num+"' size='"+arr.length+"' class='att"+num+"' style='display:none;'>";
						for(var i=0;i<arr.length;i++){
							var d = arr[i];
							html += "<option onclick=\"_clickOption('att"+num+"','"+d.CODE_NAME+"')\" value='"+d.CODE_NAME+"'>"+d.CODE_NAME+"</option>";
						}
						html += "</select>";
						$("#att"+num).after(html);
					}
				}
			});
		}

		function _changeVal(id){
			$("#codeName").val($("#"+id).val());
			id = id.replace("att","");
			var viewCode = $("#viewCode"+id).val();
			_pullList(id,viewCode);
			//_clickInput("att"+id);
		}
		
		function _clickInput(id){
			$("."+id).css("display","");
			$("."+id).css("border","1px solid #86b4f8");
			$("."+id+" s").css("background-position", "-275px -308px");
		}

		function _clickOption(id,val){
			$("#"+id).val(val);
			$("."+id).css("border","1px solid #c7c7c7");
			$("."+id+" s").css("background-position", "-275px -275px");
			id = id.replace("att","");
			$("#sel"+id).css("display","none");
			if(id=="measuring"){
				 $(".unitVal").empty();
				 $(".unitVal").text(val);
			}
		}

		function _measuringInfo(){//计量单位 flag: 2
			$.ajax({
				type:"post",
				url:'<%=path%>/postTrade/queryDirectoryInfo.do',
				dataType:"json",
				data:{flag:"2"},
				success:function(data){
					if(data){
						var arr = data.directoryList;
						var html = "";
						html += "<select id='selmeasuring' size='"+arr.length+"' class='measuring' style='display:none;overflow: hidden;margin:22px 0px 0px -150px;position: absolute;width:172px;'>";
						//if(arr.length==1)
						//else
						//	html += "<select id='selmeasuring' size='"+arr.length+"' class='measuring' style='margin:22px 0px 0px -150px;position: absolute;width:172px;'>";
						for(var i=0;i<arr.length;i++){
							var d = arr[i];
							html += "<option onclick=\"_clickOption('measuring','"+d.CODE_NAME+"')\" value='"+d.CODE_NAME+"'>"+d.CODE_NAME+"</option>";
						}
						html += "</select>";
						$("#measuring").after(html);
					}
				}
			});
		}
  	</script>
	
  </head>
  
  <body>
  	<div id="contentDiv">
  		<input type="hidden" id="itemCode" name="itemCode" value="${pro.categoryCode }">
  		<input type="hidden" id="codeName" name="codeName">
  		<input type="hidden" id="colNames" name="colNames">
  		<input type="hidden" id="shopId" name="shopId">
  		<input type="hidden" id="typePCode" name="typePCode">
  		<input type="hidden" id="imgNum" name="imgNum" value="0">
  		<input type="hidden" id="productId" name="productId" value="${productId }">
	   	<div class="title_div" style="display: none;">
	   		<div class="titleCss title_2"></div>
	   	<hr color="#ebebeb" height="0.1px" style="margin-top:13px"/>
	   	</div>
	   		<div class="main_div1">
	   			<p style="float:left;white-space: nowrap;">
	   				<strong>您选择的类目：</strong>${itemName }
	   				<c:if test="${auditStatus eq '' or auditStatus eq null}">
	   					<a style="margin-left:10px" href="#" onclick="_goBackPage()">修改</a>
	   				</c:if>
	   			</p>
	   		</div>
	   		<div style="margin: 6px 4px 4px 1px;background:#fff;font-size: 12px;">
	   			<div class="divCss_title">商品基本信息</div>
	   			<div class="div_title_css">
	   				<h4 class="tipH4">商品参数：</h4><span style="color:#999;">填错商品属性将可能导致商品下架或搜索不到，请准确填写商品属性！</span>
	   			</div>
	   			<div style="line-height:18px;">
	   				<table id="cdyPara" class="cdyParaCss" style="width: 100%;line-height: 35px;margin-top: 5px;">
	   					<tr>
	   						<td class="tdL">商品名称：</td>
	   						<td class="tdR">${pro.proName }</td>
	   					</tr>
	   					<tr>
	   						<td class="tdL">品牌名称：</td>
	   						<td class="tdR">${pro.brandName }</td>
	   					</tr>
	   				</table>
	   				<table id="cdyArea" class="cdyAreaCss" style="width: 100%;line-height: 35px;margin-top: 5px;">
		   				<tr style="">
	   						<td class="tdL" style="vertical-align: top;text-align: right;width: 152px;">买家范围：</td>
	   						<td class="tdR" style="width: 295px;text-align: left;padding-left: 10px;vertical-align: middle;" colspan="2">
	   							<div class="buyerRange" style="float: left;border: 0px;height: 22px;width: 282px">
			   						<input onclick="_clickInput('buyerRange')" style="height:19px;border: 0px;margin-top: -15px;" id="buyerRange" name="buyerRange" value="${pro.buyerRange }"/>
		   						</div>
	   						</td>
	   					</tr>
	   					<tr style="height: 100px">
	   						<td class="tdL" style="vertical-align: top;text-align: right;width: 152px;">商品销售区域：</td>
	   						<td class="tdR" style="width: 295px;text-align: left;padding-left: 10px;vertical-align: middle;">
	   							<input type="hidden" id="areaCode" name="areaCode" value="${areaCode }"/>
   								<textarea id="productArea" name="productArea" style="width: 400px; height: 100px; resize: none;" 
   									readonly="readonly">${areaName}</textarea>
		                   	</div>
	   						</td>
	   						<td style="">
	   							<button style="display:none;margin-left: 10px;height: 30px;width: 70px;background: #f3ed07;border-radius:5px;margin-top: 65px;"
	   							onclick="_showShopArea();return false;">区域选择</button>
	   						</td>
	   					</tr>
	   				</table>
	   			</div>
	   			<div class="borderCss"></div>
	   			<div  class="div_title_css">
	   				<h4 class="tipH4" style="padding-top: 4px;"><span style="color: #f00;">*</span>商品关键词：</h4>
	   				<table style="text-align: center;">
	   					<tr>
	   						<td><input id="keyWord1" name="keyWord1" readonly="readonly"/></td>
	   						<td><input id="keyWord2" name="keyWord2" readonly="readonly"/></td>
	   						<td><input id="keyWord3" name="keyWord3" readonly="readonly"/></td>
	   						<td><input id="keyWord4" name="keyWord4" readonly="readonly"/></td>
	   						<td><input id="keyWord5" name="keyWord5" readonly="readonly"/></td>
	   						<td>
		   						<span id="keyWordSpan" style="color: #f00;display:none">请输入商品关键词</span>
	   						</td>
	   					</tr>
	   				</table>
	   				<p>商品关键词用于商品匹配，并影响到搜索排名。关键词建议填写商品专业名称、别称、习惯叫法等，切勿填写与商品无关的词汇。
						<br>多可填写5个关键词，每个文本框一个关键词，每个关键词不可超过20个字符，无需添加标点符号。</p>
	   			</div>
	   			<div class="borderCss" style="display: none;"></div>
	   			<div style="display: none;" class="div_title_css">
	   				<h4 class="tipH4" style="padding-top:4px;"><span style="color: #f00;">*</span>信息标题：</h4>
	   				<input style="width:400px;height:22px;padding-left:3px;" onkeyup="_change(this.value)"/><span id="pId" style="color:#999;padding-left: 10px;">0/60字</span>
	   				<p style="padding-left:80px;">勿使用联系人、联系方式、疑问词句，特殊字符及堆砌关键词。建议包含：品牌+型号+商品关键词</p>
	   			</div>
	   		</div>
	   		<div style="margin: 6px 4px 4px 1px;background:#fff;font-size: 12px;padding-bottom: 15px;">
	   			<div class="divCss_title">商品交易信息</div>
	   			<div style="padding:20px 0px 0px 0px;">
	   				<table style="width: 100%;line-height: 40px;">
	   					<tr style="display: none;">
	   						<td class="td1">是否支持网上交易：</td>
	   						<td>
		   						<lable><input type="radio" name="onlineTrading" class="radioCss"/> 支持</lable>
		   						<lable style="padding-left:20px;"><input type="radio" name="onlineTrading" class="radioCss"/> 不支持</lable>
		   						<span style="white-space: nowrap;padding-left:30px;"> 发布支持网上交易商品，您需要提交经营资质备案。<a href="#">立即备案</a>&nbsp;&nbsp;<a href="#">备案教程</a></span>
		   					</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn">计量单位：</td>
	   						<td style="vertical-align: middle;">
	   							<div class="measuring" style="float: left;border: 1px solid #c7c7c7;height: 24px;">
			   						<input readonly="readonly" style="height:21px;border: 0px;padding-left:3px;margin-top: -18px;" value="${pro.proUnit }" id="measuring" name="measuring" placeholder="请选择计量单位"/>
		   						</div>
	   						</td>
	   					</tr>
	   					<tr style="display: none;">
	   						<td class="td1">报价方式：</td>
	   						<td>
	   							<lable><input type="radio" name="priceWay" class="radioCss"/> 电话报价</lable>
		   						<lable style="padding-left:20px;"><input type="radio" name="priceWay" class="radioCss"/> 直接报价</lable>
	   						</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn" style="vertical-align: top;padding-top:6px;">价格区间：</td>
	   						<td style="padding-top:6px;">
	   							<table class="line_color_css" style="width: 55%;line-height:52px;border: 1px solid #c7c7c7;border-top: 0px;float: left; margin-right: 30px;">
		   							<tr style="text-align: center;">
		   								<td style="width:55%"><em style="color:#f00;">*</em>&nbsp;采购数量</td>
		   								<td style="text-align: left;"><em style="color:#f00;">*</em>&nbsp;商品单价</td>
		   							</tr>
		   							<tr>
		   								<td style="padding-left:4%;">&nbsp;起批量 <input id="buyNum0" name="buyNum0" style="width: 70px;height: 22px;" readonly="readonly"/> 个以上：</td>
		   								<td style="padding-left:2%;"><input id="price0" name="price0" style="width: 70px;height: 22px;" readonly="readonly"/> 元/<span class="unitVal">${pro.proUnit}</span></td>
		   							</tr>
		   							<tr id="tr1" style="display: none;">
		   								<td>&nbsp;购&nbsp;&nbsp;买<input readonly="readonly" id="buyNum1" name="buyNum1" style="width: 70px;height: 22px;"  onblur="_onbl('buyNum1','1','buyNum0')"/>以上：</td>
		   								<td><input id="price1" name="price1" style="width: 70px;height: 22px;" onblur="_onbl('price1','2','price0')" readonly="readonly"/> 元/<span class="unitVal">${pro.proUnit}</span></td>
		   							</tr>
		   							<tr id="tr2" style="display: none;">
		   								<td>&nbsp;购&nbsp;&nbsp;买<input id="buyNum2" name="buyNum2" readonly="readonly" style="width: 70px;height: 22px;" onblur="_onbl('buyNum2','1','buyNum1')"/>以上：
		   								</td>
		   								<td><input id="price2" name="price2" style="width: 70px;height: 22px;" readonly="readonly" onblur="_onbl('price2','2','price1')"/> 元/<span class="unitVal">${pro.proUnit}</span></td>
		   							</tr>
		   						</table>
		   						<table style="width: 35%;border: 1px solid #c7c7c7;">
		   							<tr>
		   								<td style="width: 50px;background: #ebebeb;text-align: center;height: 105px;vertical-align: middle;"><span style="">预<br/>览</span></td>
		   								<td style="text-align: center;vertical-align: middle;">
		   									<table id="preview" style="width: 100%;height: 105px;padding: 0 8px;color: #999">
		   										<tr id="yl"><td colspan="2"><span style="color: #999">可根据买家采购数量的不同设置不同价格</span></td></tr>
		   										<tr id="preview0" style="display: none;">
		   											<td style="width: 40%;text-align: left;"><span id="preview01" ></span></td>
		   											<td><span id="preview02" ></span><span class="unitVal"></span></td>
		   										</tr>
		   										<tr id="preview1" style="display: none;">
		   											<td style="border-top: 1px dotted #c7c7c7;text-align: left;">
		   												<span id="preview11" ></span>
		   											</td>
		   											<td style="border-top: 1px dotted #c7c7c7">
		   												<span id="preview12" ></span><span class="unitVal"></span>
		   											</td>
		   											</tr>
		   										<tr id="preview2" style="display: none;">
		   											<td style="border-top: 1px dotted #c7c7c7;text-align: left;">
		   												<span id="preview21" ></span>
		   											</td>
		   											<td style="border-top: 1px dotted #c7c7c7">
		   												<span id="preview22" ></span><span class="unitVal"></span>
		   											</td>
		   											</tr>
		   									</table>
		   								</td>
		   							</tr>
		   						</table>
	   						</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn">供应总量：</td>
	   						<td>
	   							<input id="proStock" name="proStock" style="border: 1px solid #c7c7c7;height: 22px;width: 163px;padding-left: 4px;" readonly="readonly" value="${pro.stock }"/>&nbsp;<span class="unitVal">${pro.proUnit}</span>
	   						</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn">成本价格：</td>
	   						<td><input id="proStock" name="proStock" style="border: 1px solid #c7c7c7;height: 22px;width: 150px;padding-left: 4px;" readonly="readonly" value="${pro.cost }"/>元
	   						</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn">建议零售价格：</td>
	   						<td><input id="proRetailPrice" name="proRetailPrice" style="border: 1px solid #c7c7c7;height: 22px;width: 150px;padding-left: 4px;" readonly="readonly" value="${pro.PRODUCT_RETAIL_PRICE }"/>元
	   						</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn" style="white-space: nowrap;">是否允许退换货：</td>
	   						<td>
	   							<div class="allowReturn" style="float: left;border: 1px solid #c7c7c7;height: 22px;">
			   						<input style="height:20px;border: 0px;padding-left:5px;margin-top: -21px;" id="allowReturn" readonly="readonly" name="allowReturn" value="${pro.allowReturn }"/>
		   						</div>
	   						</td>
	   					</tr>
	   				</table>
	   			</div>
	   		</div>
	   		
	   		<div style="margin: 6px 4px 4px 1px;background:#fff;font-size: 12px;padding-bottom: 15px;">
	   			<div class="divCss_title">图片和详细说明</div>
	   			<div class="div_title_css">
	   				<h4 class="tipH4"><span style="color: #f00;">*</span>商品图片：</h4>
	   				<p style="padding-top: 0px;">您可以上传8张图片，大小不可超过2MB，第1张将做为商品主图。</p>
					<p style="padding-top: 0px;">建议上传至少3张以上，不小于500*500像素的真实图片，支持jpg,jpeg,gif,bmp格式。</p>
					<div style="border:1px solid #c7c7c7; height: 250px; width: 99%;margin-left: 83px;">
						<div id="imgDiv" style="padding-left: 30px;padding-top: 10px;">
							<div id="file1" style="float: left;padding-top: 50px;">
							</div>
						</div>
					</div>
					<br/>
					<h4 class="tipH4"><span style="color: #f00;">*</span>商品描述：</h4>
					<div style="margin-left: 83px;width: 95%; float: none;">
						<div style="border: 1px solid #c7c7c7;width: 120px;height:23px;color: #039;line-height: 23px;text-align: center;float: left;">自动生成简介</div>
						<span style="color: #999;float: right;">建议以图文结合的方式，至少插入3张以上宽度不小于700像素的细节图进行描述。不要包含联系方式</span>
					</div>
	   			</div>
		   		<div style="margin: 40px 0px 10px 163px;white-space: normal;">
		   			<input type="hidden" id="postDesc" name="postDesc"/>
		   			<script id="editor" type="text/plain" style="width:100%;height:350px;overflow: hidden;">
						${pro.proDesc }
					</script>
		   			<!-- <iframe src="<%=path %>/pages/postTrade/text.html" width="744px;" height="450px;"></iframe> --> 
		   		</div>
	   		</div>
	   		
	   		<div style="margin: 6px 4px 4px 1px;background:#fff;font-size: 12px;padding-bottom: 15px;">
	   			<div class="divCss_title">物流运费信息</div>
	   			<div style="padding:20px 0px 0px 100px;">
	   				<table style="width: 100%;line-height: 40px;">
	   					<tr>
	   						<td class="tipHn">运费模板：</td>
	   						<td >
	   							<input id="tempName" name="tempName" style="border: 1px solid #c7c7c7;height: 22px;width: 172px;"  readonly="readonly" value="${pro.TEMP_NAME }"/>
	   						</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn">单位重量：</td>
	   						<td>
	   							<input id="unitWeight" name="unitWeight" style="border: 1px solid #c7c7c7;height: 22px;width: 172px;"  readonly="readonly" value="${pro.unitWeight }"/>&nbsp;公斤/<span class="unitVal">${pro.proUnit}</span>&nbsp;&nbsp;<span style="color: #999">请选择计量单位</span>
	   						</td>
	   					</tr>
	   					<tr>
	   						<td class="tipHn">发货日期：</td>
	   						<td style="vertical-align: middle;">
	   							<div class="sendDate" style="float: left;border: 1px solid #c7c7c7;height: 24px;width: 173px;">
			   						<input readonly="readonly" style="height:21px;border: 0px;padding-left:5px;margin-top: -18px;" id="sendDate" name="sendDate" value="${pro.delDays }天内"/>
		   						</div>
	   						</td>
	   					</tr>
	   				</table>
	   			</div>
	   		</div>
	   		<div style="margin: 6px 4px 4px 1px;background:#fff;font-size: 12px;padding-bottom: 15px;">
	   			<div class="divCss_title">其他信息</div>
	   			<div style="padding:20px 0px 0px 100px;">
	   				<table style="width: 100%;line-height: 40px;">
	   					<tr>
	   						<td class="tipHn">炫铺分类：</td>
	   						<td>
	   							<input type="hidden" id="shopTypeCode" name="shopTypeCode" value="${pro.typeCode}"/>
	   							<input id="typeName" name="typeName" style="border: 1px solid #c7c7c7;height: 22px;width: 172px;"  readonly="readonly" value="${pro.PRODUCT_TYPE_NAME }"/>
	   							<!-- <select id="type1" name="type1" style="width: 130px;" onchange="_getShopyType('2',this.value,'0'),_changeShopType(this.value)" disabled="disabled">
	   								<option value="">请选择一级分类</option>
	   							</select>
	   							<select id="type2" name="type2" style="width: 130px;margin-left: 20px;" onchange="_changeShopType(this.value)" disabled="disabled">
	   								<option value="">请选择二级分类</option>
	   							</select> -->
	   						</td>
	   					</tr>
	   				</table>
	   			</div>
	   		</div>
	   		<c:if test="${auditStatus ne '' and auditStatus ne null}">
		   		<div style="margin: 6px 4px 4px 1px;background:#fff;font-size: 12px;padding-bottom: 15px;">
		   			<input type="hidden" name="auditStatus" id="auditStatus" value="${auditStatus}"/>
		   			<input type="hidden" name="uuid"  id="uuid" value="${uuid}"/>
		   			<div class="divCss_title">审核商品</div>
		   			<c:if test="${auditStatus eq '0'}">
			   			<div style="padding:20px 0px 0px 100px;">
			   				<table style="width: 100%;line-height: 40px;">
			   					<tr>
			   						<td class="tipHn">审核说明：</td>
			   						<td>
			   							<textarea id="reason" rows="3" cols="25" style="width:70%" placeholder="请输入审核说明，不超过85个字"></textarea>
			   						</td>
			   					</tr>
			   				</table>
			   			</div>
			   			<div style="height: 63px; text-align: center;margin-top:10px;">
							<button class="save" onclick="audit(1)">通过</button>
							<button class="save" onclick="audit(2)">不通过</button>
							<button class="save" onclick="history.go(-1)">返回</button>	
						</div>
					</c:if>
					<c:if test="${auditStatus eq '1'}">
						<div style="padding:2px 0px 0px 100px;">
							<table style="width: 100%;line-height: 40px;">
			   					<tr>
			   						<td class="tipHn">审核状态：</td>
			   						<td style="color:#4682B4;font-size:14px;">
			   						审核通过
			   						</td>
			   					</tr>
			   				</table>
						</div>
						<div style="height: 63px; text-align: center;margin-top:10px;">
							<button class="save" onclick="history.go(-1)">返回</button>	
						</div>
					</c:if>
					<c:if test="${auditStatus eq '2'}">
						<div style="padding:20px 0px 0px 100px;">
			   				<table style="width: 100%;line-height: 40px;">
			   					<tr>
			   						<td class="tipHn">审核说明：</td>
			   						<td>
			   							<textarea id="reason" rows="3" disabled="disabled" cols="25" style="width:70%" placeholder="请输入审核说明，不超过85个字">${auditInfo.REASON}</textarea>
			   						</td>
			   					</tr>
			   				</table>
			   			</div>
			   			<div style="padding:2px 0px 0px 100px;">
							<table style="width: 100%;line-height: 40px;">
			   					<tr>
			   						<td class="tipHn">审核状态：</td>
			   						<td style="color:#FF3030;font-size:14px;">
			   						审核未通过
			   						</td>
			   					</tr>
			   				</table>
						</div>
						<div style="height: 63px; text-align: center;margin-top:10px;">
							<button class="save" onclick="history.go(-1)">返回</button>	
						</div>
					</c:if>
		   		</div>
	   		</c:if>
  	</div>
  </body>
  	<script type="text/javascript">
  		function _keyWordLength(){//是否填写关键字验证
  	  		var len = 0;
  	  		for(var i=1;i<=5;i++){
  	  	  		len += $("#keyWord"+i).val().length;
  	  		}
  	  		if(len<=0) $("#keyWordSpan").css("display","");
  	  		else $("#keyWordSpan").css("display","none");
  		}
		function _change(value){//信息标题长度
			_keyWordLength();
			$("#pId").empty();
			$("#pId").html(value.length+"/60字");
		}
		var num = 1

		function _showImg(imgList){
			for(var i=0;i<imgList.length;i++){
				var img = imgList[i];
				var html = "<div id='imgDiv"+i+"' class='img_css'>";
				html += "<input type='hidden' id='pic"+i+"' name='pic"+i+"' value='"+img.proPic+"' />";
				html += "	<img src='"+img.proPic+"'";
				html += "		id='imgView"+i+"' style='height: 75px; width: 100px;'>";
				html += "</div>";
				$("#file1").before(html);
			}
			_reHeight("rightFrame","contentDiv");
		}

		function _getShopyType(level,pcode,flag){
			var code = "${pro.typeCode}";
			if(flag=="0"){
				code = "";
				$(".shopType").remove();
			}
			$.ajax({
				type:"post",
				url:"<%=path%>/postTrade/getShopType.do",
				dataType:"json",
				async: false,
				data:{level:level,typePCode:pcode,typeFlag:flag},
				success:function(data){
					if(data){
						var list = data.shopTypeList;
						var html = "";
						if(list.length>0) $("#shopId").val(list[0].shopId);
						if(level=="1"){
							pcode=$("#typePCode").val();
							for(var i=0;i<list.length;i++){
								html += "<option";
								if(pcode==list[i].typeCode) html += " selected=\"selected\"";
								html += " value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
							}
						}else{
							for(var i=0;i<list.length;i++){
								if(list[i].typeCode==code){
									$("#typePCode").val(list[i].typePCode);
									html += "<option class='shopType' selected=\"selected\" value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
								}else{
									html += "<option class='shopType' value='"+list[i].typeCode+"'>"+list[i].typeName+"</option>";
								}
							}
						}
						$("#type"+level).append(html);
					}
				}
			});
			_reHeight("rightFrame","contentDiv");
		}
		function _changeShopType(val){
			$("#shopTypeCode").val(val);
		}
		function _keyWord(wordList){
			for(var i=0;i<5;){
				var info = wordList[i];
				++i;
				$("#keyWord"+i).val(info.proKey);
			}
		}
		function _proPrice(list){
			for(var i=0;i<list.length;i++){
				var info = list[i];
				$("#tr"+i).css("display","");
				$("#buyNum"+i).val(info.purchaseLow);
				$("#price"+i).val(info.proPrice);
				_previewHtml(i+"",(i-1)+"");
			}
		}
		function _previewHtml(id1,id2){
			var bn = $("#buyNum"+id1).val();
			var price = $("#price"+id1).val();
			var measuring = $("#measuring").val();
			if(price == "" || bn == "") return;
			$("#yl").css("display","none");
			$("#preview"+id1).css("display","");
			var pHtml = price+" 元/"
			$("#preview"+id1+"2").text(pHtml);
			$(".unitVal").empty();
			 $(".unitVal").text(measuring);
			if(id1=="0"){
				$("#preview01").text("≥"+bn);
			}else{
				var bn1 = $("#buyNum"+id2).val();
				$("#preview"+id1+"1").text("≥"+bn);
				if(bn1 != ""){
					var num = parseInt(bn)-1;
					$("#preview"+id2+"1").text(bn1+"~"+num);
				}
				var price1 = $("#price"+id2).val();
				if(price1 != ""){
					pHtml = price1+" 元/"
					$("#preview"+id2+"2").text(pHtml);
				}
			}
			
			_reHeight("rightFrame","contentDiv");
		}
		
		  	var ue = UE.getEditor('editor');
			ue.setDisabled('fullscreen');
	//审核商品	
	function audit(refundType){
		var uuid = $("#uuid").val();
		var reason = $("#reason").val();
		if(refundType=='2'){
			if(reason==''||reason=='undefined'||reason==null){
				layer.alert("请输入不通过原因!");
				return;
			}
		}
		$.ajax({
	 		type:"GET",
			url:"<%=path%>/auditGoods/auditIfBatch.do",
			data: {
				uuid:uuid,
				rejectReason : reason,
				refundType : refundType,
				ifBatch : 'noBatch'
			},
			dataType:"json",
			async : false, //同步执行
			success:function(data){
				if(data.success){
					 layer.alert("审核成功!");
				} else {
					layer.alert("审核失败!");
				}
			},error:function(data){
			}
	 	});
	}
		$(document).ready(function(){
		  	_reHeight("rightFrame","contentDiv");
		  });
		
	</script>

</html>
